#pragma once

#include <QWidget>
#include "ui_CIOSSwitchBtn.h"

class CIOSSwitchBtn : public QWidget
{
	Q_OBJECT
private slots:
	void OnBeginAnimation();
signals:
	void sig_stateChange();
public:
	explicit CIOSSwitchBtn(QWidget *parent = Q_NULLPTR,int ctlWidth = 50,int ctlHeight=30);
	~CIOSSwitchBtn();
	void WriteSwitchBttonState(bool ios);
	bool ReadSwitchButtonState();
protected:
	virtual void paintEvent(QPaintEvent* event)override;
	virtual void mousePressEvent(QMouseEvent* event)override;
private:
	Q_DISABLE_COPY_MOVE(CIOSSwitchBtn)
private:
	Ui::CIOSSwitchBtn ui;
private:
	bool m_ios = false;
	float m_currentValue;
	float m_widthSize;
	float m_heightSize;
	QTimer* m_timer;
};
